-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Deprecate ValidateUnsigned trait and #[pallet::validate_unsigned] attribute
#10150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
ValidateUnsigned trait and #[pallet::validate_unsigned] attribute
|
For information there I had 2 PR to upgrade usage to authorize call:
I also think it is actually somewhat a breaking change. Even if the old flow with unsigned transaction is kept, using a different transaction may break indexers and application monitoring the chain through those extrinsics. IMO |
Hi @gui1117, Agreed, these 2 PR's you mentioned complement this one. What is blocking them? |
Because I think it is unnecessary breaking change. In general I don't think we should deprecate Every time we deprecate something it involves extra work for everybody using the feature. I don't see it as necessary. |
The main concern is that the SDK now needs to maintain multiple mechanisms for achieving the same goal, which increases complexity and makes the codebase harder to maintain and document consistently. Ideally, there should be a single, recommended way to validate unsigned transactions. That mechanism should be well-maintained and clearly documented. I agree that the new extension mechanism currently lacks documentation, and requiring runtime developers to explicitly include |
This is hard because frame-executive only require an applyable implementation. The definition of the transaction extension is not accessible by Frame. Maybe there is a way to make an integrity test. Note that everytime a pallet defines an extension this extension can also be missed during the runtime configuration. |
Part of #2415
Closes #2436
Related: #6325 #6326
Summary
Deprecates the
ValidateUnsignedtrait and#[pallet::validate_unsigned]attribute in favor of the newTransactionExtensionAPI. This is a non-breaking change that adds deprecation warnings to guide users toward the modern transaction validation approach.Migratees
pallet-example-offchain-workerto use theTransactionExtensionAPI.Motivation
The
ValidateUnsignedtrait was the legacy approach for validating unsigned transactions in FRAME pallets. The newerTransactionExtensiontrait provides a more flexible and composable way to handle transaction validation, including both signed and unsigned transactions.Changes
Deprecated APIs
#[deprecated]attribute toValidateUnsignedtrait#[pallet::validate_unsigned]macro attributeMigration (Using
TransactionExtensions)https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/transaction_extensions
Impact
Review Notes
#[pallet::validate_unsigned]deprecation warning might be redundant since it's always used together withValidateUnsigned, but both are included for completeness and clarity.Follow-up Tasks
The following pallets and crates need to be migrated to
TransactionExtensionin subsequent PRs:Runtime crates:
polkadot-runtime-commonpolkadot-runtime-parachainsFRAME pallets:
pallet-babepallet-beefypallet-election-provider-multi-blockpallet-grandpapallet-im-onlinepallet-mixnetCore:
frame-executiveframe-systemExamples:
pallet-example-offchain-workerTesting:
substrate-test-runtimeOpen Question
Should we remove the
ValidateUnsignedbound from the type parameterVin theApplyabletrait?